package org.ffrl.design.decoration;

import org.ffrl.design.decoration.cd.Mocha;
import org.ffrl.design.decoration.cd.Soy;
import org.ffrl.design.decoration.cd.Whip;

public class DecoratorRun {
    
    public static void main(String[] args) {
        // 不加调料
        Beverage beverage = new Espresso(1.0);
        System.out.println(beverage.getDescription() + " $" + beverage.cost());
        
        // 加调料： 双摩卡，whip
        beverage = new DarkRoast(1.0);
        beverage = new Mocha(beverage);
        beverage = new Mocha(beverage);
        beverage = new Whip(beverage);
        System.out.println(beverage.getDescription() + " $" + beverage.cost());
        
        // 加调料：Soy，whip,Mocha
        beverage = new HouseBlend(2.0);
        beverage = new Soy(beverage);
        beverage = new Mocha(beverage);
        beverage = new Whip(beverage);
        System.out.println(beverage.getDescription() + " $" + beverage.cost());
    }
}
